import request from '../index';

const baseUrl = '/base-server';

// 登录-账号密码
export const loginWithPassword = (params: any) => {
  return request({
    // url: `http://192.168.101.19:8089${baseUrl}/passport/loginWithPassword`,
    url: `${baseUrl}/passport/loginWithPassword`,
    params: params,
  });
};

// 登录-手机号验证码
export const loginWithCode = (params: any) => {
  return request({
    // url: `http://192.168.101.19:8089${baseUrl}/passport/frontLoginWithVerificationCode`,
    url: `${baseUrl}/passport/frontLoginWithVerificationCode`,
    params: params,
  });
};

// 登录-手机号验证码-发送验证码
export const sendPhoneVCode = (params: any) => {
  return request({
    // url: `http://192.168.101.19:8082${baseUrl}/passport/sendPhoneVCode`,
    url: `${baseUrl}/passport/sendPhoneVCode`,
    params: params,
  });
};

// 登录-微信授权登录
export const loginWithWx = (params: any) => {
  return request({
    // url: `http://192.168.101.19:8082${baseUrl}/passport/frontWxLogin`,
    url: `${baseUrl}/passport/frontWxLogin`,
    params: params,
  });
};

// 登录-是否登录
export const loginCheck = (params: any, flagRes?: boolean) => {
  return request({
    // url: `http://192.168.101.19:/8082${baseUrl}/passport/checkLogin`,
    url: `${baseUrl}/passport/checkLogin`,
    params: params,
    noLoading: flagRes,
  });
};

// 重置密码
export const frontUpdatePwd = (params: any) => {
  return request({
    url: `${baseUrl}/passport/frontUpdatePwd`,
    params: params,
  });
};

// 重置密码-发送验证码
export const sendMobileVCode = (params: any) => {
  return request({
    url: `${baseUrl}/passport/sendMobileVCode`,
    params: params,
  });
};
